// wglprogram.hpp
//

#ifndef _WGLPROGRAM_HPP
#define _WGLPROGRAM_HPP

#include "wgl/wglbase.hpp"
#include "wgl/wgl_gltypes.hpp"

#include "glm/mat4x4.hpp"

namespace wgl
{
  class Shader;


  
  // Program
  //
  class WGL_API Program
  {
  public:
    // Program ();
    // ~Program ();

    GLuint get_id () const { return id; }
    
    void attach_shader ( Shader &shader );

    bool link ();

    GLint get_uniform_location ( const char *name );
    void use ();

  private:
    std::vector<Shader *> shaders;
    GLuint id{0};
  };



  // UniformSlot
  //
  struct UniformSlot
  {
    GLint location;
    
    void init ( Program &program,
                const char *name );
    void setv3 ( const glm::vec3 &v );
    void setv4 ( const glm::vec4 &v );
    void setm3 ( const glm::mat3 &m );
    void setm4 ( const glm::mat4 &m );
  };
}

#endif
